<template>
  <el-dialog
    v-model="submitFormDialogVisible"
    :width="props.submitFormWidth"
    :title="props.submitFormTitle"
    :close-on-click-modal="false"
  >
    <div style="height: 680px">
      <slot name="submitDialogSlot"></slot>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <!--        <div style="float: left">-->
        <!--          <el-button type="primary" @click="previousRecord" v-show="true"-->
        <!--            >上一条-->
        <!--          </el-button>-->
        <!--          <el-button type="primary" @click="nextRecord" v-show="true"-->
        <!--            >下一条-->
        <!--          </el-button>-->
        <!--        </div>-->
        <el-button
          @click="
            changeSubmitFormDialogVisible();
            refreshData();
          "
          >取消
        </el-button>
        <el-button type="primary" @click="submit()">确认</el-button>
        <el-button
          type="primary"
          @click="
            submit();
            changeSubmitFormDialogVisible();
          "
          >确认并关闭
        </el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { inject } from "vue";

const props = inject("props");

const submitFormDialogVisible = inject("submitFormDialogVisible");

const changeSubmitFormDialogVisible = inject(
  "changeSubmitFormDialogVisible"
) as () => void;

const submit = inject("submit") as () => void;
const refreshData = inject("refreshData") as () => void;

// const previousRecord = () => {
//   // setFormInitValue();
//   console.log("previousRecord");
// };
// const nextRecord = () => {
//   console.log("nextRecord");
// };
</script>

<style scoped></style>
